﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <Header>
    <Title>InitDataGridView</Title>
    <Author>jinlei</Author>
    <Shortcut>InitDataGridView</Shortcut>
    <Description>初始化DataGridView样式</Description>
    <SnippetTypes>
      <SnippetType>SurroundsWith</SnippetType>
      <SnippetType>Expansion</SnippetType>
    </SnippetTypes>
  </Header>
  <Snippet>
    <Code Language="CSharp">
      <![CDATA[
            gv.AutoGenerateColumns = false;
            gv.AlternatingRowsDefaultCellStyle.BackColor = Color.WhiteSmoke;
            gv.RowsDefaultCellStyle.BackColor = Color.Gainsboro;
            gv.AllowUserToAddRows = false;
            gv.AllowUserToDeleteRows = false;
            gv.AllowUserToOrderColumns = false;
            gv.AllowUserToResizeColumns = false;
            gv.AllowUserToResizeRows = false;
            gv.EditMode = DataGridViewEditMode.EditOnEnter;
            gv.RowHeadersWidth = 41;
            gv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;			
            gv.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            gv.MultiSelect = false;
      ]]>
    </Code>
  </Snippet>
</CodeSnippet>